package com.oracle.oa.entity;

import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;


@Entity                        
@Table(name="calendar")
public class Calendar  implements java.io.Serializable {

	 @GenericGenerator(name = "generator", strategy = "increment")
	 @Id
	 @GeneratedValue(generator = "generator")
	 @Column(name = "id", unique = true, nullable = false)
     private int id;
	 @Column(name = "title", length = 64)
     private String title;
	 @Column(name = "start", length = 64)
     private String start;
	 @Column(name = "end", length = 64)
     private String end;
	 @Column(name = "allday")
     private int allday;
     @Column(name = "color", length = 64)
     private String color;
     @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "category")
     private Set schedules = new HashSet(0);
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public String getTitle() {
		return title;
	}
	public void setTitle(String title) {
		this.title = title;
	}
	public String getStart() {
		return start;
	}
	public void setStart(String start) {
		this.start = start;
	}
	public String getEnd() {
		return end;
	}
	public void setEnd(String end) {
		this.end = end;
	}
	public int getAllday() {
		return allday;
	}
	public void setAllday(int allday) {
		this.allday = allday;
	}
	public String getColor() {
		return color;
	}
	public void setColor(String color) {
		this.color = color;
	}
	public Set getSchedules() {
		return schedules;
	}
	public void setSchedules(Set schedules) {
		this.schedules = schedules;
	}
	public Calendar(int id, String title, String start, String end, int allday,
			String color, Set schedules) {
		this.id = id;
		this.title = title;
		this.start = start;
		this.end = end;
		this.allday = allday;
		this.color = color;
		this.schedules = schedules;
	}
	public Calendar() {
		super();
		// TODO Auto-generated constructor stub
	}
	@Override
	public String toString() {
		return "Calendar [id=" + id + ", title=" + title + ", start=" + start
				+ ", end=" + end + ", allday=" + allday + ", color=" + color
				+ ", schedules=" + schedules + "]";
	}




}